using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;

public class AssetBundleExprt : MonoBehaviour
{
    [MenuItem("Tool/AssetBundle/Export")]
   public static void ExportAssetBundle()
    {
        
        string saveDir = Application.dataPath + "/../AssetBundle";

        if (Directory.Exists(saveDir))
        {
            Directory.Delete(saveDir,true);
        }
        Directory.CreateDirectory(saveDir); 
        BuildPipeline.BuildAssetBundles(saveDir,
            BuildAssetBundleOptions.ForceRebuildAssetBundle |
            BuildAssetBundleOptions.ChunkBasedCompression,
            BuildTarget.StandaloneWindows);
    }
    
}
